﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SysAdmin._04_Form._00_Common
{
    public partial class ConfirmDialogForm : Form
    {
        public string Msg { get; set; }

        public ConfirmDialogForm()
        {
            InitializeComponent();
        }

        private void ConfirmDialogForm_Load(object sender, EventArgs e)
        {
            label1.Text = Msg;
        }

        private void ConfirmDialogForm_Shown(object sender, EventArgs e)
        {
            int distance = ClientSize.Height - button1.Location.Y;
            int x = ClientSize.Width / 2 - label1.Width / 2;
            int y = (ClientSize.Height - distance) / 2 - label1.Height / 2;
            label1.Location = new Point(x, y);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}
